<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class UserVip extends Model
{
    //vip
    protected $table = 'user_vip';

    public function user_vip_info()
    {
        return $this->belongsTo(UserVipInfo::class,'user_id','user_id');
    }

    /**
     * 获取器
     */
    public function getActivateAttribute($value)
    {
        if(!empty($value)){
            $time = explode(" ", $value);
            return $time[0]??'';
        }else{
            return "";
        }
    }
}
